package com.ryder.petmatediarybackend.module.auth.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

/**
 * 描述: 用户登录 DTO
 *
 * @author Ryder
 * @version 1.0
 * @since 1.0
 * 更新日期: 2025/10/27
 */
@Data
@Schema(description = "用户登录请求")
public class LoginDTO {

    @NotBlank(message = "用户名不能为空")
    @Schema(description = "用户名", example = "testuser")
    private String username;

    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = "^(?=.*[a-zA-Z])(?=.*\\d)(?=.*[^a-zA-Z\\d\\u4e00-\\u9fa5])(?!.*[\\u4e00-\\u9fa5]).{7,20}$",
            message = "密码格式不正确：7-20位，必须包含字母、数字、特殊字符，不能包含中文")
    @Schema(description = "密码（7-20位，必须包含字母、数字、特殊字符，不能包含中文）", example = "Test@12")
    private String password;

    @NotBlank(message = "设备类型不能为空")
    @Schema(description = "设备类型（WEB/APP）", example = "WEB")
    private String deviceType;
}
